//
//  MVTableViewCell.m
//  Gunz
//
//  Created by Joggy on 16/1/22.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "MVTableViewCell.h"

@implementation MVTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    _headImage = [[UIImageView alloc] initWithFrame:CGRectMake(MVCInsert*4, (MVCCellHeight - MVCInsert - MVCHeadImageWidth)/2, MVCHeadImageWidth, MVCHeadImageWidth)];
    _headImage.image = [UIImage imageNamed:@"插图1"];
    _cellTitle = [[UILabel alloc] initWithFrame:CGRectMake(_headImage.frame.origin.x + _headImage.frame.size.width + MVCInsert*4, _headImage.frame.origin.y, MVCTitleWidth, font15)];
    _cellTitle.text = @"超市采购数据采集";
    _cellTitle.font = [UIFont systemFontOfSize:font15];
    _cellTitle.textColor = [UIColor colorWithRed:0.3 green:0.345 blue:0.43 alpha:1];
    _detail = [[TYAttributedLabel alloc] initWithFrame:CGRectMake(_headImage.frame.origin.x + _headImage.frame.size.width + MVCInsert*4, _cellTitle.frame.origin.y + font14 + MVCInsert*2, MVCDetailWidth, font15*3 + MVCInsert)];
    _detail.text = @"对用户超市购物清单数据采集，大众任务";
    _detail.font = [UIFont systemFontOfSize:font15];
    _detail.textColor = [UIColor colorWithRed:0.53 green:0.53 blue:0.53 alpha:1];
    _detail.numberOfLines = 2;
    _detail.backgroundColor = [UIColor clearColor];
    //价格
    _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(screenWidth - 80, 8, 66, 20)];
//    NSMutableAttributedString *priceTitle = [[NSMutableAttributedString alloc] initWithString:@"5￥"];
//    [priceTitle addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:1 green:0.5 blue:0 alpha:1] range:priceRange];
//    _priceLabel.attributedText = priceTitle;
    _priceLabel.textColor = [UIColor colorWithRed:1 green:0.5 blue:0 alpha:1];
    _priceLabel.font = [UIFont systemFontOfSize:18];
    _priceLabel.textAlignment = NSTextAlignmentRight;
    _priceLabel.text = @"50¥";
//    _priceLabel.layer.position = CGPointMake(screenWidth - MVCInsert*2.5 - _priceLabel.frame.size.width/2, _cellTitle.layer.position.y);
    
    [self.contentView addSubview:_headImage];
    [self.contentView addSubview:_cellTitle];
    [self.contentView addSubview:_detail];
    [self.contentView addSubview:_priceLabel];
    self.contentView.backgroundColor = [UIColor whiteColor];
    self.backgroundColor = [UIColor clearColor];
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
